namespace hjc {
	export class Velocity extends Component {

		private $speed: number;
		private $angle: angle;
		public get speed(): number { return this.$speed; }
		public set speed(speed: number) { this.$speed = speed; }
		public get angle(): number { return this.$angle; }
		public set angle(angle: angle) { this.$angle = angle; }
		public get vct2(): [number, number] {
			let rad = Math.angleToRadian(this.$angle);
			return [Math.cos(rad) * this.$speed, Math.sin(rad) * this.$speed];
		}

		public init(speed?: number): void {
			this.$speed = 0;
			this.$angle = 0;
			super.resetPfc();
			if (numeric(speed)) this.speed = speed;
		}
	}
}